Skip to content
This repository was archived by the owner on Nov 27, 2025. It is now read-only.

Refactor generators#83

Merged
AlexeyRaga merged 7 commits intomasterfrom
refactor-generators
Nov 15, 2025
Merged

Refactor generators#83
AlexeyRaga merged 7 commits intomasterfrom
refactor-generators

Conversation

@AlexeyRaga
Copy link
Copy Markdown
Collaborator

@AlexeyRaga AlexeyRaga commented Nov 14, 2025

This pull request introduces significant improvements to generic type generation and recursion handling in the Hedgehog.Experimental library, along with comprehensive new tests for complex generic parameter mapping and recursion-aware generators.

Generic Type Generation and Recursion Support

  • Added a new AutoGenContext type to allow custom generators to respect recursion limits, enabling safer recursive data structure generation. The generic generator registration logic now supports methods that accept RecursionContext as a parameter.
  • Updated documentation and F# examples to demonstrate how to register and use generic generators with recursion support, including examples for ImmutableList<'a> and other generic types.

Complex Generic Parameter Mapping

  • Added new tests and generator implementations to verify correct mapping of generic parameters, including cases with repeated and out-of-order type arguments. This ensures that custom generator methods can handle complex generic type patterns.

C# Test Coverage for Default Generators

  • Introduced a comprehensive suite of C# tests validating automatic generation for various collection types (including immutable collections and dictionaries) and recursive types, ensuring interoperability and correctness of the generic generation system.

Recursive and Mutually Recursive Type Handling

  • Improved mutually recursive type generation logic in F#, ensuring correct handling of recursion depth and preventing stack overflows. Also added tests to verify that recursion limits are respected and that generated data structures reach the expected depth.

These changes collectively make the generic type generation system more robust, flexible, and easier to extend for both F# and C# users.

@AlexeyRaga AlexeyRaga merged commit d58d284 into master Nov 15, 2025
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant